﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using HPortal.Lib;
using System.Data;
using System.Data.SqlClient;
using System.Web.Security;

namespace HPortal.Module
{
    public partial class HtmlDocument : PanelControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                DataTable sa = DatabaseHelper.Select(new string[] { "Top 1 Content" }, "Article", "ArticleID IN (Select ItemID From PanelList WHERE PanelID=" + PanelID + ") AND [Status]>2", "PublishedTime DESC");
                if (sa.Rows.Count > 0)
                {
                    ltrContent.Text = sa.Rows[0][0].ToString();
                }
            }
        }
    }
}